﻿Imports System.Configuration
Imports System
Imports System.Collections.Specialized
Imports System.Text
Imports System.IO

Imports doan_1065019_1065001.AppSettingsWriter
Public Class frmCapNhatGiaTriDinhSan

    Dim thang As String = 0
    Dim ngay_nha As String = 0
    Dim ngay_ct As String = 0
    Public username As String = ""
    Private Sub TrangChuToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrangChuToolStripMenuItem.Click
        Me.Close()
    End Sub
    Private Sub frmCapNhatGiaTriDinhSan_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim appcofig As AppSettingsReader = New AppSettingsReader
        ' load cbthang
        Dim thang1 As String = AppSettingsWriter.GetValue("ThangLapBaoCao")
        If (thang1 = "0") Then
            cbthang.SelectedIndex = 0
        Else
            cbthang.SelectedIndex = 1
        End If

        'load cbNgayTNNthue
        Dim ngay_nha1 As String = AppSettingsWriter.GetValue("NgayTiepNhanNhaThue")
        If (ngay_nha1 = "0") Then
            cbNgayTNNThue.SelectedIndex = 0
        Else
            cbNgayTNNThue.SelectedIndex = 1
        End If

        'load cbNgayCty
        Dim ngay_ct1 As String = AppSettingsWriter.GetValue("NgayTiepNhanCongTyMoiGioi")
        If (ngay_ct1 = "0") Then
            cbNgayTNCTy.SelectedIndex = 0
        Else
            cbNgayTNCTy.SelectedIndex = 1
        End If

    End Sub
  
    Private Sub btnCapNhatThang_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCapNhatThang.Click
        Dim w As AppSettingsWriter = New AppSettingsWriter()
        w.SetValue("ThangLapBaoCao", thang)
    End Sub

    Private Sub cbthang_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbthang.SelectedIndexChanged
        If (cbthang.SelectedIndex <> -1) Then
            thang = cbthang.SelectedIndex.ToString()
        End If

    End Sub
    Private Sub btnNgayTiepNhanNha_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNgayTiepNhanNha.Click
        Dim w As AppSettingsWriter = New AppSettingsWriter()
        w.SetValue("NgayTiepNhanNhaThue", ngay_nha)
    End Sub

   
    Private Sub cbNgayTNNThue_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbNgayTNNThue.SelectedIndexChanged
        If (cbNgayTNNThue.SelectedIndex <> -1) Then
            ngay_nha = cbNgayTNNThue.SelectedIndex.ToString()
        End If


    End Sub

    Private Sub cbNgayTNCTy_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbNgayTNCTy.SelectedIndexChanged
        If (cbNgayTNCTy.SelectedIndex <> -1) Then
            ngay_ct = cbNgayTNCTy.SelectedIndex.ToString()
        
        End If


    End Sub

    Private Sub btnNgayTiepNhanCTMG_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNgayTiepNhanCTMG.Click

        Dim w As AppSettingsWriter = New AppSettingsWriter()
        w.SetValue("NgayTiepNhanCongTyMoiGioi", ngay_ct)
    End Sub
End Class